﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="index.aspx.cs" Inherits="index" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>EasyCRM 客户关系管理</title>
    <link href="./css/ecrm03.css" rel="stylesheet" type="text/css" />
    <link href="./css/ecrm02.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="./js/Function.js"></script>
    <script type="text/javascript" src="./js/myCheck.js"></script>
    <script type="text/javascript" src="./js/jquery5685.js"></script>
    <script type="text/javascript" src="./js/ecrm13027.js"></script>
    <script language="javascript" type="text/javascript">
        window.onload = emailFieldInit;

        function emailFieldInit() {
	        var email = "";
	        //if (document.cookie != "") {
		    //    email = document.cookie.split("=")[1];
	        //}
	        
	        email=getCookie("ecrmemail");

	        document.getElementById("email").value = email;
        }
        
        function getCookie(name){
              var strCookie=document.cookie;
              var arrCookie=strCookie.split("; ");
              for(var i=0;i<arrCookie.length;i++){
                    var arr=arrCookie[i].split("=");
                    if(arr[0]==name)return arr[1];
              }
              return "";
        }
        
        function addCookie(name,value,expireHours){
              var cookieString=name+"="+escape(value);
              //判断是否设置过期时间,0=永不过期
              if(expireHours>0){
                     var date=new Date();
                     date.setTime(date.getTime+expireHours*3600*1000);
                     cookieString=cookieString+"; expire="+date.toGMTString();
              }
              document.cookie=cookieString;
        }

        function deleteCookie(name){
               var date=new Date();
               date.setTime(date.getTime()-10000);
               document.cookie=name+"=v; expire="+date.toGMTString();
        }

        function setCookie() {
	        var expireDate = new Date();
	        expireDate.setMonth(expireDate.getMonth()+6);
        	
	        var email = document.getElementById("email").value;
	        document.cookie = "ecrmemail=" + email + ";expires=" + expireDate.toGMTString();
        }
        
        function saveCookie()
        {
            if(document.getElementById("remember").checked==true)
            {
                setCookie();
	            //var email = document.getElementById("email").value;
                
                //addCookie("ecrmemail",email,10);???????
            }
        }
    </script>
    <script type="text/javascript" language="javascript">
        function chk()
        {
			if(CheckEMail(form1.email)==false) return false;
			//if(CheckPassword(form1.password)==false) return false;
            
            saveCookie();
            
			return true;
        }

        function getnews(pagenum)
        {
	        var urlstring='./ajax/article_list.aspx?pagenum='+pagenum+'&_='+(new Date()).getTime();            	        $.ajax({	            url:urlstring,	            type:'get',	            dataType:'html',	            beforeSend:function()	            {	                $("#news_area").empty().append("<img id='loading' src='./images/loading2.gif' />正在加载,请稍等......");	            },	            error:function()	            {	                $("#news_area").empty().append("read error!");	            },	            success: function(msg)	            {	                $("#news_area").empty().append(msg);	            }	        });        }
        
	    $(document).ready(function(){            $("#regusers").load("./ajax/get_regusers.ashx");            $("#linkmans").load("./ajax/get_linkmans.ashx");            getnews(1);            $("#top20").load("./ajax/sort_top20.aspx");	    });        
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <table width="96%" border="0" cellpadding="0" cellspacing="0" align="center">
            <tr>
                <td style="font-weight: bold; font-size: 10pt;">
                    <div id="nav"><a class="now" href="index.aspx"><span>首页</span></a><a href="my_ecrm.aspx">我的名片夹</a><a href="my_givelist.aspx"><span>我的赠刊名录</span></a><a href="my_plan.aspx"><span>我的周计划</span></a><a href="easybbs.aspx"><span>员工交流区</span></a><a href="employee2.aspx"><span>员工联系表</span></a><a href="webdisk/default.aspx"><span>网盘</span></a></div>
                    <div class="clear"></div><div id="status"><div id="subnav"></div><span class="pl"><asp:Literal ID="userstatus1" runat="server"></asp:Literal><asp:Literal ID="userstatus2" runat="server"></asp:Literal></span></div>
                    <h1>欢迎来到EasyCRM</h1>
                    <table border=0 cellpadding=2 cellspacing=2 width=100%>
                        <tr>
                            <td width="50%" valign="top" align="right"><br />
                                <div style="padding-left:50px;">
                                    <div style="text-align: left;font-size: 11pt; color: midnightblue;">&nbsp;·系统已经有注册用户&nbsp;<font style="color: goldenrod;"><span id="regusers"></span></font>&nbsp;人</div>
                                    <div style="text-align: left;font-size: 11pt; color: midnightblue;">&nbsp;·系统共收录&nbsp;<font style="color: goldenrod;"><span id="linkmans"></span></font>&nbsp;个联系人</div>
                                    <br />
                                    <div style="text-align: left">
                                        <table border=0 cellpadding=0 cellspacing=0 width=520>
                                            <tr>
                                                <td style="border-bottom: dimgray 1px dashed; font-weight: bold; font-size: 18px; color: #003399;">&nbsp;公告栏</td>
                                            </tr>
                                            <tr>
                                                <td><div id="news_area"></div></td>
                                            </tr>
                                        </table>
                                    </div>
                                </div>
                            </td>
                            <td width="50%" valign="top">
                                <div style="padding-left:50px;">
                                    <h2>登录  · · · · · ·</h2>
                                    <table class="infobox">
                                        <tr><td class="tablelt"></td><td class="tablect"></td><td class="tablert"></td></tr>
                                        <tr><td class="tablelc"></td><td class="tablecc">
                                            <div class="login_input"><span class="m">&nbsp;Email: </span><asp:TextBox ID="email" runat="server" Width="160"></asp:TextBox></div>
                                            <div class="login_input"><span class="m">密&nbsp;&nbsp;&nbsp;码: </span><asp:TextBox ID="password" runat="server" TextMode="Password" Width="160"></asp:TextBox></div>
                                            <div class="login_input"><span class="m">验证码: </span><asp:TextBox ID="vercode" runat="server" Width="80"></asp:TextBox>&nbsp;<asp:Image id="vcode" runat="server" ImageAlign="AbsBottom"></asp:Image></div>
                                            <div class="login_end">
                                            <input id="remember" name="remember" type="checkbox"/>&nbsp; <span style="color:#AAA;" class="pl">在这台电脑上记住我</span>
                                                <div style="margin-top:.5em;">
                                                    <asp:Button ID="btnLogin" runat="server" Text="登录" Width="58px" OnClick="btnLogin_Click" /><font style="font-size: 10pt; color: red;"><asp:Literal ID="msg" runat="server"></asp:Literal></font>
                                                <a style="float:right;margin-top:.5em;" href="./user/user_reback_pwd.aspx">忘记密码了</a>
                                                </div>
                                            </div>
                                        </td><td class="tablerc"></td></tr>
                                        <tr><td class="tablelb"></td><td class="tablecb"></td><td class="tablerb"></td></tr>
                                    </table>
                                    <p style="margin-bottom:34px;margin-top:15px"><a style="font-size:14px;color:#336797;" href="./user/user_reg.aspx">&gt;&gt; 立即注册</a></p>
                                </div>
                                <br />
                            </td>
                        </tr>
                    </table>
                    <br />
                    <div style="border-bottom: darkgray 1px solid;"></div>
                    <span class="bottomfont">SEEC&copy; 2008-2009 汽车中国</span>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>
